<!doctype html>
<html>

	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<!-- Apple devices fullscreen -->
		<meta name="apple-mobile-web-app-capable" content="yes">
		<!-- Apple devices fullscreen -->
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
		<link href="../css/main.css?v=12u234y" rel="stylesheet" type="text/css">
		<link href="../css/page.css" rel="stylesheet" type="text/css">
		<link href="../font/css/font-awesome.min.css" rel="stylesheet" />
		<!--[if IE 7]>
  <link rel="stylesheet" href="../font/css/font-awesome-ie7.min.css">
<![endif]-->
		<link href="../js/jquery-ui/jquery-ui.min.css" rel="stylesheet" type="text/css" />
		<link href="../js/perfect-scrollbar.min.css" rel="stylesheet" type="text/css" />
		<style type="text/css">
			html,
			body {
				overflow: visible;
			}
		</style>
		<script type="text/javascript" src="../js/jquery.js"></script>
		<script type="text/javascript" src="../js/jquery-ui/jquery-ui.min.js"></script>
		<script type="text/javascript" src="../js/layer/layer.js"></script>
		<!-- 弹窗js 参考文档 http://layer.layui.com/-->
		<script type="text/javascript" src="../js/admin.js"></script>
		<script type="text/javascript" src="../js/flexigrid.js"></script>
		<script type="text/javascript" src="../js/jquery.validation.min.js"></script>
		<script type="text/javascript" src="../js/perfect-scrollbar.min.js"></script>
		<script type="text/javascript" src="../js/jquery.mousewheel.js"></script>
		<script src="../js/myFormValidate.js"></script>
		<script src="../js/myAjax2.js"></script>
		<script src="../js/global.js"></script>
		<script type="text/javascript" src="../js/demo_page.js" ></script>
		<script type="text/javascript">
			function delfunc(obj) {
				layer.confirm('确认删除？', {
					btn: ['确定', '取消'] //按钮
				}, function() {
					$.ajax({
						type: 'post',
						url: $(obj).attr('data-url'),
						data: {
							act: 'del',
							del_id: $(obj).attr('data-id')
						},
						dataType: 'json',
						success: function(data) {
							if(data == 1) {
								layer.msg('操作成功', {
									icon: 1
								});
								$(obj).parent().parent().parent().remove();
							} else {
								layer.msg(data, {
									icon: 2,
									time: 2000
								});
							}
						}
					})
				}, function(index) {
					layer.close(index);
					return false; // 取消
				});
			}

			function delAll(obj, name) {
				var a = [];
				$('input[name*=' + name + ']').each(function(i, o) {
					if($(o).is(':checked')) {
						a.push($(o).val());
					}
				})
				if(a.length == 0) {
					layer.alert('请选择删除项', {
						icon: 2
					});
					return;
				}
				layer.confirm('确认删除？', {
					btn: ['确定', '取消']
				}, function() {
					$.ajax({
						type: 'get',
						url: $(obj).attr('data-url'),
						data: {
							act: 'del',
							del_id: a
						},
						dataType: 'json',
						success: function(data) {
							if(data == 1) {
								layer.msg('操作成功', {
									icon: 1
								});
								$('input[name*=' + name + ']').each(function(i, o) {
									if($(o).is(':checked')) {
										$(o).parent().parent().remove();
									}
								})
							} else {
								layer.msg(data, {
									icon: 2,
									time: 2000
								});
							}
							layer.closeAll();
						}
					})
				}, function(index) {
					layer.close(index);
					return false; // 取消
				});
			}

			//表格列表全选反选
			$(document).ready(function() {
				$('.hDivBox .sign').click(function() {
					var sign = $('#flexigrid > table>tbody>tr');
					if($(this).parent().hasClass('trSelected')) {
						sign.each(function() {
							$(this).removeClass('trSelected');
						});
						$(this).parent().removeClass('trSelected');
					} else {
						sign.each(function() {
							$(this).addClass('trSelected');
						});
						$(this).parent().addClass('trSelected');
					}
				})
			});

			//获取选中项
			function getSelected() {
				var selectobj = $('.trSelected');
				var selectval = [];
				if(selectobj.length > 0) {
					selectobj.each(function() {
						selectval.push($(this).attr('data-id'));
					});
				}
				return selectval;
			}
		</script>
	</head>

	<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
		<div id="append_parent"></div>
		<div id="ajaxwaitid"></div>
		<div class="page">
			<div class="fixed-bar">
				<div class="item-title">
					<div class="subject">
						<h3>商品管理</h3>
						<h5>商城所有商品索引及管理</h5>
					</div>
					<ul class="tab-base nc-row">
						<li>
							<a class="current" href="javascript:;" data-state="" onclick="get_goods_list(this)"><span>所有商品</span></a>
						</li>
						<li>
							<a href="javascript:;" data-state="0" onclick="get_goods_list(this)"><span>等待审核</span></a>
						</li>
						<li>
							<a href="javascript:;" data-state="1" onclick="get_goods_list(this)"><span>审核通过</span></a>
						</li>
						<li>
							<a href="javascript:;" data-state="2" onclick="get_goods_list(this)"><span>审核失败</span></a>
						</li>
						<li>
							<a href="javascript:;" data-state="3" onclick="get_goods_list(this)"><span>违规下架</span></a>
						</li>
					</ul>
				</div>
			</div>
			<!-- 操作说明 -->
			<div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%;">
				<div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
					<h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
					<span title="收起提示" id="explanationZoom" style="display: block;"></span>
				</div>
				<ul>
					<li>平台可以强制下架商家违规的产品，对于商家发布的商品需要审核.</li>
					<li>上架，当商品处于非上架状态时，前台将不能浏览该商品，店主可控制商品上架状态</li>
					<li>违规下架，当商品处于违规下架状态时，前台将不能购买该商品，只有管理员可控制商品违规下架状态，并且商品只有重新编辑后才能上架</li>
				</ul>
			</div>
			<div class="flexigrid">
				<div class="mDiv">
					<div class="ftitle">
						<h3>商品列表</h3>
						<h5></h5>
					</div>
					<form action="" id="search-form2" class="navbar-form form-inline" method="post" onsubmit="return false">
						<div class="sDiv">
							<div class="sDiv2">
								<select name="cat_id" id="cat_id" class="select">
									<option value="">所有分类</option>
									<option value="5"> A 阿斯顿发-l</option>
									<option value="6"> A 阿萨德法师打发-l</option>
									<option value="43"> C 床</option>
									<option value="17"> D 单反</option>
									<option value="54"> D 大米</option>
									<option value="3"> D 电池 电源 充电器</option>
									<option value="27"> D 电脑办公</option>
									<option value="18"> D 电视</option>
									<option value="48"> D 迪奥</option>
									<option value="24"> F 非人工复古风格</option>
									<option value="47"> H 化妆品</option>
									<option value="46"> H 海澜之家</option>
									<option value="20"> H 黑白电视</option>
									<option value="28"> J 家居家具</option>
									<option value="25"> J 家用电器</option>
									<option value="16"> J 景点门票</option>
									<option value="7"> J 计生情趣</option>
									<option value="14"> L 旅游出行</option>
									<option value="35"> L 礼品鲜花</option>
									<option value="53"> L 粮食</option>
									<option value="21"> M 母婴</option>
									<option value="33"> M 母婴 / 玩具乐器</option>
									<option value="56"> M 玫瑰花</option>
									<option value="30"> M 美妆个护宠物</option>
									<option value="22"> N 奶粉</option>
									<option value="45"> N 男装</option>
									<option value="29"> N 男装女装</option>
									<option value="49"> N 男鞋</option>
									<option value="31"> N 男鞋户外</option>
									<option value="42"> P 苹果</option>
									<option value="52"> P 苹果汽车</option>
									<option value="32"> Q 汽车 / 汽车用品</option>
									<option value="51"> Q 汽车车座</option>
									<option value="15"> Q 签证门票</option>
									<option value="39"> S 三星</option>
									<option value="44"> S 三星大床</option>
									<option value="40"> S 三鹿奶粉</option>
									<option value="12"> S 手机</option>
									<option value="38"> S 手机</option>
									<option value="1"> S 手机 、 数码 、 通信</option>
									<option value="4"> S 手机城</option>
									<option value="26"> S 手机数码</option>
									<option value="11"> S 手机通讯</option>
									<option value="2"> S 手机配件</option>
									<option value="13"> S 摄影设备</option>
									<option value="34"> S 食品酒类</option>
									<option value="41"> T 台式机</option>
									<option value="37"> T 图书音像</option>
									<option value="50"> T 特步</option>
									<option value="10"> X 相机数码</option>
									<option value="55"> X 鲜花</option>
									<option value="36"> Y 医药保健</option>
									<option value="23"> Y 婴幼奶粉</option>
									<option value="19"> Y 液晶电视</option>
								</select>
								<select name="brand_id" id="brand_id" class="select">
									<option value="">所有品牌</option>
								</select>
								<input type="hidden" name="goods_state" id="goods_state">
								<input type="hidden" name="is_on_sale" id="is_on_sale">
								<!--排序规则-->
								<input type="hidden" name="orderby1" value="goods_id" />
								<input type="hidden" name="orderby2" value="desc" />
								<input type="text" size="30" name="key_word" class="qsbox" placeholder="搜索词...">
								<input type="button" onclick="ajax_get_table('search-form2',1)" class="btn" value="搜索">
							</div>
						</div>
					</form>
				</div>
				<div class="hDiv">
					<div class="hDivBox">
						<table cellspacing="0" cellpadding="0">
							<thead>
								<tr>
									<th align="left" abbr="article_title" axis="col6" class="">
										<div style="text-align: left; width:50px;" class="" onclick="sort('goods_id');">商品id</div>
									</th>
									<th align="left" abbr="ac_id" axis="col4" class="">
										<div style="text-align: left; width: 300px;" class="" onclick="sort('goods_name');">商品名称</div>
									</th>
									<th align="center" abbr="article_show" axis="col6" class="">
										<div style="text-align: center; width: 100px;" class="" onclick="sort('goods_sn');">货号</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 200px;" class="" onclick="sort('cat_id');">分类</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 50px;" class="" onclick="sort('shop_price');">价格</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 50px;" class="">库存</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 50px;" class="" onclick="sort('is_recommend');">推荐</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 50px;" class="" onclick="sort('is_new');">新品</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 50px;" class="" onclick="sort('is_hot');">热卖</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 50px;" class="" onclick="sort('is_on_sale');">商品状态</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 50px;" class="" onclick="sort('goods_state');">审核状态</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 100px;" class="">店铺名称</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 50px;" class="">店铺类型</div>
									</th>
									<th align="center" abbr="article_time" axis="col6" class="">
										<div style="text-align: center; width: 120px;">操作</div>
									</th>
									<th style="width:100%" axis="col7">
										<div></div>
									</th>
								</tr>
							</thead>
						</table>
					</div>
				</div>
				<div class="bDiv" style="height: auto;">
					<!--ajax 返回 -->
					<div id="ajax_return" cellpadding="0" cellspacing="0" border="0">
						<table>
							<tbody>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="149">149 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;">wewqe</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">qwe</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">计生情趣</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">1.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">100</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="no" onclick="changeTableVal('goods','goods_id','149','is_recommend',this)"><i class="fa fa-ban"></i>否</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="no" onclick="changeTableVal('goods','goods_id','149','is_new',this)"><i class="fa fa-ban"></i>否</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="no" onclick="changeTableVal('goods','goods_id','149','is_hot',this)"><i class="fa fa-ban"></i>否</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">平台联营</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="149" goods_sn="qwe" goods_name="wewqe">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/149.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="148">148 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;"> 商品测试1块钱</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">TP0000148</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">电脑办公</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">1.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">4</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','148','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','148','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','148','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">加盟店</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="148" goods_sn="TP0000148" goods_name=" 商品测试1块钱">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/148.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="147">147 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;">Dior/迪奥变色唇膏粉漾魅惑润唇蜜口红持久保湿001/004/0...</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">TP000003612</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">美妆个护宠物</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">1.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">12</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','147','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','147','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','147','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">加盟店</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="147" goods_sn="TP000003612" goods_name="Dior/迪奥变色唇膏粉漾魅惑润唇蜜口红持久保湿001/004/005">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/147.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="146">146 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;">包邮实木单人床1米1.2m松木双人床1.5M大床1.8米简易木床可...</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">TP0000035</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">家居家具</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">121.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">12</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','146','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','146','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','146','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">加盟店</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="146" goods_sn="TP0000035" goods_name="包邮实木单人床1米1.2m松木双人床1.5M大床1.8米简易木床可定制床">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/146.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="145">145 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;">iMaciMaciMaciMaciMaciMac</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">TP0000034</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">电脑办公</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">22222.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">12</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','145','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','145','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','145','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">加盟店</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="145" goods_sn="TP0000034" goods_name="iMaciMaciMaciMaciMaciMac">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/145.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="144">144 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;">JackJones杰克琼斯男装秋季新款帅气修身机车PU皮夹克短款外...</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">TP0000033</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">男装女装</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">1000.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">12</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','144','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','144','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','144','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">加盟店</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="144" goods_sn="TP0000033" goods_name="JackJones杰克琼斯男装秋季新款帅气修身机车PU皮夹克短款外套">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/144.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="143">143 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;">纽康特neocate中文版1段氨基酸配方粉400g 适用婴儿牛奶蛋...</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">TP0000032</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">母婴</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">234.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">12</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','143','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','143','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','143','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">加盟店</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="143" goods_sn="TP0000032" goods_name="纽康特neocate中文版1段氨基酸配方粉400g 适用婴儿牛奶蛋白过敏">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/143.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="142">142 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;">西安旅游华清宫门票（华清池+骊山）咨询客服有惊喜西安旅游华清宫门票...</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">TP0000031</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">旅游出行</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">123.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">12</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','142','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','142','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','142','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">加盟店</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="142" goods_sn="TP0000031" goods_name="西安旅游华清宫门票（华清池+骊山）咨询客服有惊喜西安旅游华清宫门票（华清池+骊山）咨询客服有惊喜西安旅游华清宫门票（华清池+骊山）咨询客服有惊喜西安旅游华清宫门票（华清池+骊山）咨询客服有惊喜">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/142.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="141">141 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;">三星GALAXY S8 SM-G9500公开版全网通手机</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">TP0000030</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">手机数码</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">1111.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">12</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','141','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','141','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','141','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">加盟店</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="141" goods_sn="TP0000030" goods_name="三星GALAXY S8 SM-G9500公开版全网通手机">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/141.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>
								<tr>
									<td align="center" axis="col0">
										<div style="width: 50px;">
											<input type="checkbox" name="goods_id[]" value="140">140 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 300px;">三星GALAXY S8 SM-G9500公开版全网通手机</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: left; width: 100px;">TP0000029</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 200px;">手机数码</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">20003.00</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">12</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','140','is_recommend',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','140','is_new',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											<span class="yes" onclick="changeTableVal('goods','goods_id','140','is_hot',this)"><i class="fa fa-check-circle"></i>是</span>
										</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 60px;">
											出售中 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">
											通过 </div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 100px;">E线商城旗舰店铺</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 50px;">加盟店</div>
									</td>
									<td align="center" axis="col0">
										<div style="text-align: center; width: 120px; max-width:120px;">
											<a class="btn red" href="javascript:void(0);" onclick="takeoff(this)" goods_id="140" goods_sn="TP0000029" goods_name="三星GALAXY S8 SM-G9500公开版全网通手机">
												<i class="fa fa-ban"></i>下架</a>
											<a class="btn blue" target="_blank" href="/index.php/Home/Goods/goodsInfo/id/140.html"><i class="fa fa-search"></i>查看</a>
										</div>
									</td>
									<td align="" class="" style="width: 100%;">
										<div>&nbsp;</div>
									</td>
								</tr>

								<tr class="spe_select">
									<td colspan="14">
										<div class="col-sm-3 form-inline">
											全选
											<input type="checkbox" onclick="$('input[name=\'goods_id\[\]\']').prop('checked', this.checked);">

											<select id="func_id" class="form-control" style="width: 120px;" onchange="fuc_change(this);">
												<option value="-1">请选择...</option>
												<option value="0">推荐</option>
												<option value="1">新品</option>
												<option value="2">热卖</option>
												<option value="3">审核商品</option>
											</select>
											<select id="state_id" class="form-control" style="display: none" onchange="state_change(this);">
												<option value="">请选择...</option>
												<option value="0">待审核</option>
												<option value="1">审核通过</option>
												<option value="2">审核失败</option>
											</select>
											<a id="act_button" href="javascript:;" onclick="act_submit();" style="color:#FFF;" class="ncap-btn-mini ncap-btn-green"><i class="fa"></i> 确定</a>
										</div>
									</td>
								</tr>
							</tbody>
						</table>
						<div class='dataTables_paginate paging_simple_numbers'>
							<ul class='pagination' id="page">
							</ul>
						</div>
					</div>
				</div>
			</div>
			<script>
				$(document).ready(function() {

					// 表格行点击选中切换
					$('#ajax_return').on('click', 'table>tbody >tr', function() {
						if(!$(this).hasClass('spe_select')) {
							$(this).toggleClass('trSelected');

							var checked = $(this).hasClass('trSelected');
							$(this).find('input[type="checkbox"]').attr('checked', checked);
						}
					});
					// 刷选条件 鼠标 移动进去 移出 样式
					$(".hDivBox > table > thead > tr > th").mousemove(function() {
						$(this).addClass('thOver');
					}).mouseout(function() {
						$(this).removeClass('thOver');
					});

					// 复选框事件 不联动父类
					$('#ajax_return').on('click', 'table>tbody >tr input', function(e) {
						//alert('bbb');
						e.stopPropagation();
					})

				});
			</script>
			<script>
				$(document).ready(function() {
					// ajax 加载商品列表
					ajax_get_table('search-form2', 1);

				});

				// ajax 抓取页面 form 为表单id  page 为当前第几页
				function ajax_get_table(form, page) {
					cur_page = page; //当前页面 保存为全局变量
					$.ajax({
						type: "POST",
						url: "/index.php?m=Admin&c=goods&a=ajaxGoodsList&p=" + page, //+tab,
						data: $('#' + form).serialize(), // 你的formid
						success: function(data) {
							$("#ajax_return").html('');
							$("#ajax_return").append(data);
						}
					});
				}

				// 点击排序
				function sort(field) {
					$("input[name='orderby1']").val(field);
					var v = $("input[name='orderby2']").val() == 'desc' ? 'asc' : 'desc';
					$("input[name='orderby2']").val(v);
					ajax_get_table('search-form2', cur_page);
				}

				// 删除操作
				function del(id) {
					if(!confirm('确定要删除吗?'))
						return false;
					$.ajax({
						url: "/index.php?m=Admin&c=goods&a=delGoods&id=" + id,
						success: function(v) {
							var v = eval('(' + v + ')');
							if(v.hasOwnProperty('status') && (v.status == 1))
								ajax_get_table('search-form2', cur_page);
							else
								layer.msg(v.msg, {
									icon: 2,
									time: 1000
								}); //alert(v.msg);
						}
					});
					return false;
				}

				//获取选中商品id
				function get_select_goods_id_str() {
					if($('input[name="goods_id\[\]"]:checked').length == 0)
						return false;
					var goods_arr = Array();
					$('input[name="goods_id\[\]"]:checked').each(function() {
						goods_arr.push($(this).val());
					});
					var goods_id_str = goods_arr.join(',');
					return goods_id_str
				}

				act = ''; //操作变量
				//批量操作
				function fuc_change(obj) {
					var fuc_val = $(obj).children('option:selected').val();
					if(fuc_val == 0) {
						//推荐
						act = 'recommend';
						$('#act_button').removeClass('disabled');
						reset_state();
					} else if(fuc_val == 1) {
						act = 'new';
						$('#act_button').removeClass('disabled');
						reset_state();
						//新品
					} else if(fuc_val == 2) {
						act = 'hot';
						$('#act_button').removeClass('disabled');
						reset_state();
						//热卖
					} else if(fuc_val == 3) {
						act = 'examine';
						$('#state_id').show();
						$('#act_button').addClass('disabled');
						$("#state_id option:first").prop("selected", 'selected');
						//审核商品
					} else {
						act = '';
						$('#act_button').addClass('disabled');
						reset_state();
						//恢复默认
					}
				}

				//重置审核操作
				function reset_state() {
					$("#state_id option:first").prop("selected", 'selected');
					$('#state_id').hide();
				}

				//审核操作
				function state_change(obj) {
					var state_val = $(obj).children('option:selected').val();
					if(state_val == '') {
						$('#act_button').addClass('disabled');
					} else {
						$('#act_button').removeClass('disabled');
					}
				}

				//批量操作提交
				function act_submit() {
					var ids = get_select_goods_id_str();
					if(ids == false) {
						layer.alert('请勾选要操作的商品', {
							icon: 2
						});
						return;
					}
					var fun_id = $('#func_id').find("option:selected").val();
					var goods_state = $('#state_id').children('option:selected').val();
					if(fun_id == 3 && goods_state == 2) {
						layer.prompt({
							title: '请输入操作备注(<b style="color:red;">必填</b>)',
							formType: 2
						}, function(text, index) {
							layer.close(index);
							request_net(ids, text);
						});
					} else {
						request_net(ids, '无备注');
					}
				}

				function request_net(ids, text) {
					if(text == "") {
						layer.alert('请填写备注', {
							icon: 2,
							time: 3000
						});
					} else {
						var goods_state = $('#state_id').children('option:selected').val();
						$.ajax({
							type: "POST",
							url: "/index.php?m=Admin&c=goods&a=act", //+tab,
							data: {
								act: act,
								goods_state: goods_state,
								goods_ids: ids,
								reason: text
							},
							dataType: 'json',
							success: function(data) {
								if(data.status == 1) {
									layer.alert(data.msg, {
										icon: 1,
										closeBtn: 0
									}, function() {
										window.location.reload();
									});
								} else {
									layer.alert(data.msg, {
										icon: 2,
										time: 3000
									});
								}

							},
							error: function() {
								layer.alert('网络异常', {
									icon: 2,
									time: 3000
								});
							}
						});
					}
				}

				function get_goods_list(obj) {
					var state = $(obj).attr('data-state');
					$('.tab-base').find('a').removeClass('current')
					$(obj).addClass('current');
					if(state == '3') {
						$("#is_on_sale").val(2);
						$("#goods_state").val('');
					} else {
						$("#is_on_sale").val('');
						$("#goods_state").val(state);
					}
					ajax_get_table('search-form2', 1);
				}

				function takeoff(obj) {
					var reasonhtml = '<div class="dialog_body" style="position: relative;">';
					reasonhtml += '<div class="dialog_content" style="margin: 0px; padding: 0px;">';
					reasonhtml += '<div class="ncap-form-default">';
					reasonhtml += '<dl class="row">';
					reasonhtml += '<dt class="tit">违规商品货号</dt><dd class="opt">' + $(obj).attr('goods_sn') + '</dd></dl>';
					reasonhtml += '<dl class="row">';
					reasonhtml += '<dt class="tit">违规商品名称</dt><dd class="opt">' + $(obj).attr('goods_name') + '</dd></dl>';
					reasonhtml += '<dl class="row"><dt class="tit">';
					reasonhtml += '<label for="close_reason">违规下架理由</label>';
					reasonhtml += '<input type="hidden" id="take_goods_id" value="' + $(obj).attr('goods_id') + '"></dt>';
					reasonhtml += '<dd class="opt">';
					reasonhtml += ' <textarea rows="6" class="tarea" cols="60" name="close_reason" id="close_reason"></textarea>';
					reasonhtml += ' </dd></dl>';
					reasonhtml += '<div class="bot"><a href="javascript:void(0);" onclick="takeoff_goods();" class="ncap-btn-big ncap-btn-green" nctype="btn_submit">确认提交</a></div>';
					reasonhtml += '</div></div></div>'
					layer.open({
						type: 1,
						title: '违规下架理由',
						skin: 'layui-layer-rim', //加上边框
						area: ['620px', '340px'], //宽高
						content: reasonhtml
					});
				}

				function takeoff_goods() {
					$.ajax({
						type: "POST",
						url: "/index.php?m=Admin&c=goods&a=act", //+tab,
						data: {
							act: 'takeoff',
							is_on_sale: 2,
							goods_ids: $('#take_goods_id').val(),
							reason: $('#close_reason').val()
						},
						dataType: 'json',
						success: function(data) {
							if(data.status == 1) {
								layer.alert(data.msg, {
									icon: 1,
									closeBtn: 0
								}, function() {
									window.location.reload();
								});
							} else {
								layer.alert(data.msg, {
									icon: 2,
									time: 3000
								});
							}
						},
						error: function() {
							layer.alert('网络异常', {
								icon: 2,
								time: 3000
							});
						}
					});
				}

				//页码单击事件
				function pageClick(obj) {
					$(".paginate_button").removeClass("active");
					var page = $(obj).children().text();
					currPage = page;
					$(obj).addClass("active");
					//在此处调用页码单击事件
				}
				//获取总数据
				totalRecord = 13;
				showpage();
			</script>
	</body>

</html>